package com.zh.test.fastdfs;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;
/**
 * @Author zh
 * @Description  测试,文件上传service
 * @Date 2020/9/3 
 * @Param 
 * @return 
 **/
@Service
public class fastdfsService {

    @Autowired
    fastdfsUtil fastdfsUtil;

    public  String uploadFromPath(String filePath){
        filePath = Optional.ofNullable(filePath).orElse("D:\\company\\lesu\\MapAndStream.png");
        String uploadPath = fastdfsUtil.upload(filePath);

        return uploadPath;
    }
}
